<html>
<head>
    <title>后台管理系统</title>
    <meta charset="UTF-8">
    <script src="../scripts/jquery.min.js"></script>
    <script src="../scripts/miniui/miniui.js"></script>
    <link href="../scripts/miniui/themes/default/miniui.css" rel="stylesheet">
    <link href="../scripts/miniui/themes/icons.css" rel="stylesheet">
    <script src="../scripts/boot.js"></script>
    <script src="../scripts/core.js"></script>
    <link href="../scripts/miniui/themes/pure/skin.css" rel="stylesheet">
</head>
<script type="text/javascript">
    var auth = GetParams()
    mini.parse();

    var tree = mini.get("leftTree");

    function showTab(node) {
        var tabs = mini.get("mainTabs");

        var id = "tab$" + node.id;
        var tab = tabs.getTab(id);
        if (!tab) {
            tab = {};
            tab._nodeid = node.id;
            tab.name = id;
            tab.title = node.text;
            tab.showCloseButton = true;

            //这里拼接了url，实际项目，应该从后台直接获得完整的url地址
            tab.url = node.url + "?authId=" + auth.authId + "&token=" + auth.token;

            tabs.addTab(tab);
        }
        tabs.activeTab(tab);
    }

    function onNodeSelect(e) {
        var node = e.node;
        var isLeaf = e.isLeaf;

        if (isLeaf) {
            showTab(node);
        }
    }

    function onClick(e) {
        var text = this.getText();
        alert(text);
    }

    function onQuickClick(e) {
        tree.expandPath("datagrid");
        tree.selectNode("datagrid");
    }

    function backToLogin() {
        window.location = "login.html"
    }

    function onTabsActiveChanged(e) {

    }
</script>

<body>

<!--Layout-->
<div class="mini-layout" id="layout1" style="width:100%;height:100%;">
    <div class="app-header" height="70" region="north" showHeader="false" showSplit="false">
        <h1 onclick="backToLogin()" style="margin:0;padding:15px;cursor:pointer;font-family:微软雅黑,黑体,宋体;">
            游戏后台管理系统</h1>


    </div>
    <div height="30" region="south" showHeader="false" showSplit="false" title="south">
        <div style="line-height:28px;text-align:center;cursor:default">Copyright © 游戏有限公司版权所有</div>
    </div>
    <div bodyStyle="overflow:hidden;" region="center" style="border:0;" title="center">
        <!--Splitter-->
        <div class="mini-splitter" style="width:100%;height:100%;">
            <div maxSize="250" minSize="100" showCollapseButton="true" size="180" style="border:0;">
                <!--OutlookTree-->
                <div class="mini-outlooktree" id="leftTree" idField="id" onnodeclick="onNodeSelect"
                     parentField="pid" textField="text" url="../data/outlooktree.txt">
                </div>

            </div>
            <div showCollapseButton="false" style="border:0;">
                <!--Tabs-->
                <div activeIndex="2" class="mini-tabs" id="mainTabs" onactivechanged="onTabsActiveChanged"
                     plain="false" style="width:100%;height:100%;">

                </div>
            </div>
        </div>
    </div>
</div>


</body>
</html>